  <script type="text/javascript" src="../Public/js/ajax.js"></script>
   
   <link rel="stylesheet" href="../Public/style/public_index.css" />
   <style>
   .yuan{ border-radius:50%}
  
   </style>
  <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}<div class="search sprite_icon">
			     <span class="icon2 icon_com">
			 </div>
		 </div>
	 </div>         
<!-- banner -->
	  <YP:flash flashid="41" key="kid" />

    <include file="Mobile:nav"/>  

	 <div class="c_designer c_caption_com">
		 <div class="caption" id="a">设计师</div>

		 <ul class="list clear">
        
          {php $result=M('User')->where('posid=1 and groupid=1')->order('listorder,pos_time asc')->limit(6)->select();
                foreach($result as $k=>$r):}
			 
			 <li  {if $k%2==0}class="no_border_right" {/if}>
				 <div class="c_pic fl">
					<a href="index.php?g=Mobile&m=Homepage&a=index&id={$r['id']}"> <img class="yuan"  height="50" width="50" src="{$r['avatar']}" alt="" /></a>
				 </div>

				 <div class="c_info fl">
					 <a href="index.php?g=Mobile&m=Homepage&a=index&id={$r['id']}"><h3>{$r['username']}</h3></a>
					 <a href="index.php?g=Mobile&m=Homepage&a=index&id={$r['id']}" class="c_more">查看更多</a>
				 </div>
			 </li>
		{php endforeach;}	
			 
			 
			 
		 </ul>
		 <a href="index.php?g=Mobile&m=Yuyue&a=index&id=4" class="c_load_more">
			 点击查看更多&gt;
		 </a>
	 </div>

	 <div class="c_case c_caption_com P_color">
		 <div class="caption" id="c">案例图</div>
		 <ul class="list">
	{php $field='jg_case.id,jg_case.pic,jg_case.title,jg_case.status,jg_case.posid,jg_case.describe,jg_user.id as userid,jg_user.avatar,jg_user.username as un';
     $where='jg_case.`status`=1 and jg_case.catid=1 and jg_case.`posid`=1';
     $reluts=M('Case')->field($field)->where($where)->join('jg_user ON jg_case.userid = jg_user.id')->order("jg_case.pos_time desc")->limit('3')->select();}
     
  {php foreach($reluts as $key=>$val):}		 
			 
			 <li class="clear no_border_bottom">
              <a href="index.php?g=Mobile&m=Case&a=show&id={$val['id']}">
				 <div class="pic fl">
					 <img src="{$val['pic']}" alt="" />
					 <p class="explain"><span>{$val['title']}</span></p>
				 </div>
              </a>  
				 <div class="c_portrait fr">
					 <a href="index.php?g=Mobile&m=Homepage&a=index&id={$val['userid']}" id="keep_url"><img class="yuan" src="{$val['avatar']}" height="60" width="60" alt="" />
					 <p class="name" id="realname">{$val['un']}</p></a>
					 <a href="javascript:onclick=keep({$val['userid']})" class="collenct">收藏TA</a>
				 </div>
			 </li>
    {php endforeach;}         
		 </ul>
		 <a href="index.php?g=Mobile&m=Case&a=index&id=1" class="c_load_more">
			 点击查看更多&gt;
		 </a>
	 </div>

	 <div class="c_effect P_color c_caption_com">
		 <div class="caption" id="b">效果图</div>

		 <ul class="list clear">
			<YP:list name="Case"  id="r" key="k" where="status=1 and posid=1 and catid=2" limit="6">  
			 <li {if $k%2==0}class="no_margin_right" {/if}>
				 <a href="index.php?g=Mobile&m=Case&a=show&id={$r['id']}">
					 <div class="pic">
						 <img src="{$r['thumb_list']}" height="96" alt="" />
					 </div>
					 <p class="explain">{$r['title']}</p>
				 </a>
			 </li>
			</YP:list> 
			 
			 
			 
		 </ul>
		 
		 <a href="index.php?g=Mobile&m=Case&a=index&id=2" class="c_load_more">
			 点击查看更多&gt;
		 </a>
	 </div>

	 
	 <div class="c_way c_caption_com P_color">
		 <div class="caption" id="d">餐饮资讯</div>

		 <ul class="list">
			 
		  <YP:list name="News" where="posid=1" catid="14,15,16,17,18,19" order="pos_time desc" limit="3" key="k" id="r">	 
			 <li>
				 <a href="index.php?g=Mobile&m=News&a=show&id={$r.id}" class="clear">
					 <div class="pic fl">
						 <img src="{$r['pic']}" alt="" />
					 </div>

					 <div class="info fr">
						 <h2>{$r['title']}</h2>
						 <div style="width:100%; height:55px;"><p>{$r['description']|str_cut=###,70}</p></div>
						 <div class="sprite_icon clear">
							 <span class="icon1 icon_com"></span><em class="margin_right">{$r['createtime']|date="m-d",###}</em>
							 <span class="icon2 icon_com"></span><em>{$r['hits']}</em>
						 </div>
					 </div>
				 </a>
			 </li>
           </YP:list> 
		 </ul>

		 <a  href="index.php?g=Mobile&m=News&a=index&id=3" class="c_load_more">
			 点击查看更多&gt;
		 </a>
	 </div>

	 <div class="c_find_designer P_color">
		 <a href="tel:{$Hotline}">
             <div class="find">找设计师请拨打</div>
             <div class="phone clear">
                 <span class="icon1 fl"></span>
                 <strong class="fl">{$Hotline}</strong>
             </div>
         </a>
	 </div>






<script>
function  keep(id){
	
	
		  var module='User';
		 // var catid='2'
		  var url=$("#keep_url").attr('href');
		  var title=$("#realname").html();
		 
      //alert(title);
		  //var userid=$("#keep_u").attr('name');
		 // alert(userid)
	
		  $.post(
				  'index.php?g=Mobile&m=User&a=keep', 
				  {'id':id,
				   'module':module,
				   'url':url,
				   'title':title,
				  
				  },
				  function(res){
					 // alert(res)
					 if(res.length>1000){
						 alert('您还未登录，请您先登录');
						 } else{
							 alert(res);
							 if(res=='收藏成功!'){
							  var keepnum=parseInt($("#keep_n"+id).html())+1;
							  $("#keep_n"+id).html(keepnum);
							  }
						 }
					 
					});
	  
	}





</script>




